<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html ng-app="AlarmApp">
<head>
<base href="<%=basePath%>">

<title>My JSP 'alarmList.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

<style type="text/css">
.controls.inline>* {
	display: inline-block;
}

.controls.inline>input {
	width: 100px;
}
</style>
</head>

<body>
	<div class="row-fluid" ng-controller="alarmAddCtrl">
		<!-- block -->
		<div class="block">
			<div class="navbar navbar-inner block-header">
				<div class="muted pull-left">添加警情</div>
			</div>
			<div class="block-content collapse in">
				<form class="form-horizontal" id='addAlarmForm'>
					<div class="span6">
						<fieldset>
							<legend>添加警情</legend>
							<div class="control-group">
								<label class="control-label" for="focusedInput">单位名称:</label>
								<div class="controls">
									<input type="hidden" name="id" value="${alarm.id}"/>
									<input class="input-xlarge focused" id="focusedInput"
										type="datetime" name="company_name" value="${alarm.company_name}">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">报警时间:</label>
								<div class="controls">
									<input class="input-xlarge disabled datetimepicker" id="disabledInput"
										type="datetime" placeholder="" name="alarm_time" value="${alarm.alarmTimeString}">
								</div>
							</div>
							 <div class="control-group">
								<label class="control-label" for="disabledInput">所属网格:</label>
								<div class="controls">
									<select name="grid_id" value="${grid_id}" value="${alarm.grid_id }">
										<option ng-repeat="data in allGrids" value="{{data.id}}">{{data.name}}</option>
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">类型</label>
								<div class="controls">
									<select id="selectError" name="type" value="${alarm.type}">
										<c:forEach items="${ alarmType}" var="type" varStatus="status">
											<option value="${type.id}">${type.name}</option>
										</c:forEach>
									</select> 
								</div>
							</div>
							<div class="control-group warning">
								<label class="control-label" for="inputError">警情描述</label>
								<div class="controls">
									<input type="text" name="p_desc" value="${alarm.p_desc}"> 
								</div>
							</div>
							<div class="control-group warning">
								<label class="control-label" for="inputError">故障类型</label>
								<div class="controls">
									<input type="text" name="error_type" value="${alarm.error_type}"> 
								</div>
							</div>
							<div class="control-group error">
								<label class="control-label" for="inputError">处理结果</label>
								<div class="controls">
									<select id="selectError" name="result" value="${alarm.result}">
										<c:forEach items="${resultType}" var="type" varStatus="status">
											<option value="${type.id}">${type.name}</option>
										</c:forEach>
										<!-- <option value="1">未处理</option>
										<option value="2">已处理</option>
										<option value="3">经确认为误报</option>
										<option value="4">已经生成任务单</option> -->
									</select>
								</div>
							</div>
							<div class="form-actions">
								<button type="button" class="btn btn-primary"
									ng-click="addAlarm()">保存</button>
								<button type="reset" class="btn">重置</button>
							</div>
						</fieldset>
					</div>
					<div class="span6">
						<fieldset>
								<div class="navbar navbar-inner block-header">
									<div class="muted pull-left"></div>
								</div>
							<div class="control-group">
								<label class="control-label" for="focusedInput">报警地址:</label>
								<div class="controls">
									<input class="input-xlarge focused" id="focusedInput"
										type="text" name="alarm_address"  value="${alarm.alarm_address}">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">公司法人:</label>
								<div class="controls">
									<input class="input-xlarge disabled" id="disabledInput"
										type="text" placeholder="" name="legal_person"  value="${alarm.legal_person}">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="disabledInput">消防负责人:</label>
								<div class="controls">
									<input class="input-xlarge disabled" id="disabledInput"
										type="text" placeholder="" name="principal_man"  value="${alarm.principal_man}">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">消控中心电话</label>
								<div class="controls">
									<input type="datetime" name="fire_control_tel"  value="${alarm.fire_control_tel}">
								</div>
							</div>
							<div class="control-group warning">
								<label class="control-label" for="inputError">联系电话:</label>
								<div class="controls">
									<input type="text" name="grid_tel"  value="${alarm.grid_tel}"> 
								</div>
							</div>
							<div class="control-group warning">
								<label class="control-label" for="inputError">设备制造单位:</label>
								<div class="controls">
									<input type="text" name="device_made_unit"  value="${alarm.device_made_unit}"> 
								</div>
							</div>
							<div class="control-group error">
								<label class="control-label" for="inputError">型号:</label>
								<div class="controls">
									<input type="text" name="model"  value="${alarm.model}"> 
								</div>
							</div>
							<div class="control-group error">
								<label class="control-label" for="inputError">分管维保单位:</label>
								<div class="controls">
									<input type="text" name="support_unit"  value="${alarm.support_unit}"> 
								</div>
							</div>
							<div class="control-group error">
								<label class="control-label" for="inputError">单位电话:</label>
								<div class="controls">
									<input type="text" name="support_tel"  value="${alarm.support_tel}"> 
								</div>
							</div>
						</fieldset>
					</div>
				</form>
			</div>
		</div>
		<!-- /block -->
	</div>
	<script>
		/* var app = angular.module('alarmApp', []);
		app.controller('alarmCtrl', function($scope, $http) {
			$http.post("addAlarm.json").success(function(response) {
				$scope.alarmList = response;
			});
		}); */
	</script>
</body>
</html>
